Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Passing temp-tables by reference or by binding
What should you do when the call is always or sometimes local? In these situations, you can optimize your code by passing the
Note: When you pass temp-tables by reference or by binding, all of the possible inter-operability between static and dynamic temp-tables applies, as described inTABLE-HANDLEparameter by reference or binding (starting with OpenEdge Release 10.1A). Both of these options are described in the "Using a temp-table as a parameter" section.
Table 20–2.TABLE-HANDLE form with BY-REFERENCE
To pass a
TABLE-HANDLEby reference, use this syntax for theRUNstatement in the calling routine:
If the called routine’s temp-table is a static temp-table, you can save the overhead of instantiating it by defining it as
REFERENCE-ONLY:
TABLE-HANDLE form with BIND
To pass a
TABLE-HANDLEby binding, you must specify theBINDkeyword in both the calling and the called routines to tell Progress to use the same temp-table instance for both routines. If the temp-table that will be used as a pointer is static, use theREFERENCE-ONLYkeyword when you define the temp-table. Alternately, if the temp-table that will be used as a pointer is dynamic, set theTABLE-HANDLEparameter toUNKNOWN.For example, use this syntax in the calling routine:
In the called routine, use this syntax:
In whichever routine that contains the temp-table that is not being used, you should define that temp-table as
REFERENCE-ONLYif it is static:
For example, if you are using the called routine’s temp-table data, you define the calling routine’s static temp-table as
REFERENCE-ONLY. If you are using the calling routine’s temp-table data, you define the called routine’s static temp-table asREFERENCE-ONLY.Alternately, if the unused temp-table is dynamic, you should set the
TABLE-HANDLEparameter toUNKNOWN.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |